package com.lirh.pojo;

import java.util.HashMap;
import java.util.Set;

public class TreeNode {
    private String content;
    private HashMap<String,TreeNode> childs;

    public String childsToString(){
        StringBuffer string = new StringBuffer();
        Set<String> strings = childs.keySet();
        for (String s:strings){
    //        System.out.println(s);
            string=string.append(s).append("、");
        }
        return string.toString();
    }

    public TreeNode(String content, HashMap<String, TreeNode> childs) {
        this.content = content;
        this.childs = childs;
    }

    public String getContent() {
        return content;
    }

    public HashMap<String, TreeNode> getChilds() {
        return childs;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setChilds(HashMap<String, TreeNode> childs) {
        this.childs = childs;
    }

    @Override
    public String toString() {
        return content+":"+childsToString();
    }
}
